

#include "Macros.asm"

BasicBuildings .equ 1
ResearchBuildings .equ 2


StructuresMenu .equ 1
ShipMenu .equ 0
OperationsMenu .equ 2
Argo_Laboratory_Menu .equ 3
AdvancedStructuresMenu .equ 4

Draw_Menu:

 ld a, (MenuIdentity)		;What menu are we displaying? 
 cp StructuresMenu
 jr z, Draw_Structures_Menu
 cp AdvancedStucturesMenu
 jr z, Draw_Advanced_Structures_Menu 

Draw_Structures_Menu:



 ld hl, Build_Basic_Buildings

 call Draw_Icon_Menu

 ret

Draw_Advanced_Structures_Menu:

 ld hl, Build_Research_Buildings

 call Draw_Icon_Menu

 ret


AddBuildingToGame:  

 BIT Object_Ready_To_Add, (IY + asm_flag1)
 jr nz, _

 SET Object_Ready_To_Add, (IY + asm_flag1)
 CALL Rotate_Cursor_Mode
 ld a,c
 ld (BuildingSelected),a
 RET




_

 RES Object_Ready_To_Add, (IY + asm_flag1)
 CALL Rotate_Cursor_Mode
 
Copy_Screen_After_Buildings:

	BIT Cursor_Mode, (IY + asm_flag1)
	ret nz
	ld hl, plotsscreen
	call safeCopy
	
	ret



fastCopy:
	di
	ld a,$80
	out ($10),a
	ld hl,plotsscreen-12-(-(12*64)+1)
	ld a,$20
	ld c,a
	inc hl
	dec hl
_
	ld b,64
	inc c
	ld de,-(12*64)+1
	out ($10),a
	add hl,de
	ld de,10
_
	add hl,de
	inc hl
	inc hl
	inc de
	ld a,(hl)
	out ($11),a
	dec de
	djnz -_
	ld a,c
	cp $2B+1
	jr nz,--_
	ei
	ret	
 

